package cn.ainit.fx.fho;

import java.util.Date;

import javax.servlet.http.HttpSession;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import cn.ainit.sys.common.dao.BusinessBaseDao;

@Repository
public class FxHandOutDaoImpl extends BusinessBaseDao implements FxHandOutDao{

	@Override
	public Boolean updateFHOByRunId(FxHanParam fxHanParams,HttpSession session) throws Exception {
		Boolean flag=false;
		try {
			String hql="update FxHandOut s set  s.isVerify=?,s.verifyDate=?,s.packNum=? where s.runId=?";
			Query query= sessionFactory.getCurrentSession().createQuery(hql);
			query.setString(0,"1");
			query.setDate(1,new Date(System.currentTimeMillis()));
			query.setInteger(2,fxHanParams.getPackNum());
			query.setString(3, fxHanParams.getRunId());
			flag=query.executeUpdate()==1?true:false;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return flag;
	}

}
